<#import "/layout.html" as c>
    <#import "/list_layout.html" as list>
        <#assign alertList = []/>
        <@c.html title="Index">
        <!-- ================== 开始页面级CSS调用 ================== -->
        <link href="${pluginsRoot}bootstrap-wizard/css/bwizard.min.css" rel="stylesheet"/>
        <!-- 日历控件 -->
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/WdatePicker.css" rel="stylesheet"/>
        <link href="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/skin/default/datepicker.css" rel="stylesheet"/>
        <!-- ================== 结束页面级CSS调用 ================== -->
        <@list.html title="banner设置" subTitle="banner设置" alertList=alertList permi="sys:banner:save" addBtn=true searchHint="请输入标题进行搜索">


        <@shiro.hasPermission name="sys:banner:edit">
            <input type="hidden" id="bannerEdit" value="1"/>
        </@shiro.hasPermission>
        <@shiro.hasPermission name="sys:banner:del">
            <input type="hidden" id="bannerDel" value="1"/>
        </@shiro.hasPermission>
<!-- 结束用户权限参数 -->

    <!-- 开启添加banner模态窗口 -->
    <div class="modal fade" id="addModal" tabindex="-1" role="dialog">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title"> 添加首页banner </h4>
                </div>
                <div class="modal-body">
                    <form id="addForm" class="form-horizontal form-bordered p-0" autocomplete="off" action="${adminRoot}banner/json/add" method="post" data-parsley-validate="true">
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">标题<i class="f-s-14 text-danger">*</i>&nbsp;: </label>
                            <div class="col-md-9 col-sm-8">
                                <input type="text" name="title" class="form-control" placeholder="请输入标题" data-tip="tooltip" data-placement="auto" data-original-title="必填项，3-20个大小写英文字母、符号或数字。" data-parsley-required="true" data-parsley-length="[3,20]"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">选择代理商<i class="f-s-14 text-danger">*</i>&nbsp;: </label>
                            <div class="col-md-9 col-sm-8">
                                <select id ="agentAdd" name="agentId" class="form-control" data-parsley-required="true" >
                                    <option value ="">--请选择--</option>
                                    <#if type?? &&type==1>
                                        <option value ="0">所有代理商</option>
                                    </#if>
                                    <#if agents??>
                                        <#list agents as agent>
                                            <option value ="${agent.id}">${agent.name!}</option>
                                        </#list>
                                    </#if>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">图片<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                            <div class="col-md-9 col-sm-8">
                                <input type="hidden" id="addFormPicPath" name="picPath">
                                <div class="clickreply-image m-b-15"><img src="${imgRoot}default_image.gif" id="addFormPicImg" alt="" class="media-object viewImage"></div>
                                <p class="text-info">封面图片尺寸要求宽度为360像素、高度为200像素,最大为2M；支持格式gif，jpg，png，jpeg。</p>
                                <span class="btn btn-sm btn-white fileinput-button"> <i class="fa fa-upload"></i> <span>文件上传</span>
                                <input id="addFormPic" type="file" name="file" autocomplete="off" multiple>
                                </span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">跳转链接&nbsp;: </label>
                            <div class="col-md-9 col-sm-8">
                                <input type="url" data-parsley-type="url" name="linkUrl" class="form-control" placeholder="请输入跳转链接" data-tip="tooltip" data-placement="auto" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">排序<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                            <div class="col-md-9 col-sm-8">
                                <input type="number" class="form-control" name="sortNo" autocomplete="off" placeholder="排序" value="0" data-tip="tooltip" data-placement="auto"  data-parsley-required="true" data-original-title="排序从0~999顺序排列，默认排序为0。" data-parsley-range="[0,999]"/>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="control-label col-md-2 col-sm-3">是否显示&nbsp;*: </label>
                            <div class="col-md-9 col-sm-8">
                                <input type="checkbox" class="status" autocomplete="off"
                                       data-input-name="status"
                                       data-size="small"
                                       data-on-color="primary"
                                       data-on-text="显示"
                                       data-off-text="隐藏"
                                       data-input-true="1"
                                       data-input-false="2"
                                       checked/>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="addForm" nc-ajax-submit>确认提交</a> </div>
            </div>
        </div>
    </div>
    <!-- 结束添加banner模态窗口 -->

<!-- 开启编辑管理员模态窗口 -->
<div class="modal fade" id="editModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title"> banner编辑 </h4>
            </div>
            <div class="modal-body">
                <form id="editForm" class="form-horizontal form-bordered p-0" autocomplete="off" action="${adminRoot}/banner/json/edit" method="post" data-parsley-validate="true">
                    <input type="hidden" id="id" name="id"/>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">标题<i class="f-s-14 text-danger">*</i>&nbsp;: </label>
                        <div class="col-md-9 col-sm-8">
                            <input type="text" id="title" name="title" class="form-control" placeholder="请输入标题" data-tip="tooltip" data-placement="auto" data-original-title="必填项，3-20个大小写英文字母、符号或数字。" data-parsley-required="true" data-parsley-length="[3,20]"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">选择代理商<i class="f-s-14 text-danger">*</i>&nbsp;: </label>
                        <div class="col-md-9 col-sm-8">
                            <select id ="agentEdit" name="agentId" class="form-control" data-parsley-required="true" >
                                <#if type?? &&type==1>
                                    <option value ="0">所有代理商</option>
                                </#if>
                                <#if agents??>
                                    <#list agents as agent>
                                        <option value ="${agent.id}">${agent.name!}</option>
                                    </#list>
                                </#if>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">图片&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="hidden" id="editFormPicPath" name="picPath">
                            <div class="clickreply-image m-b-15"><img src="${imgRoot}default_image.gif" id="editFormPicImg" alt="" class="media-object viewImage"></div>
                            <p class="text-info">封面图片尺寸要求宽度为360像素、高度为200像素,最大为2M；支持格式gif，jpg，png，jpeg。</p>
                            <span class="btn btn-sm btn-white fileinput-button"> <i class="fa fa-upload"></i> <span>文件上传</span>
                            <input id="editFormPic" type="file" name="file" autocomplete="off" multiple>
                            </span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">跳转链接&nbsp;: </label>
                        <div class="col-md-9 col-sm-8">
                            <input type="url" data-parsley-type="url" id="linkUrl" name="linkUrl" class="form-control" placeholder="请输入跳转链接" data-tip="tooltip" data-placement="auto" data-original-title="必填项，请输入跳转链接。"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">排序<i class="f-s-14 text-danger">*</i>&nbsp;:</label>
                        <div class="col-md-9 col-sm-8">
                            <input type="number"id="sortNo" class="form-control" name="sortNo" autocomplete="off" placeholder="排序" value="0" data-tip="tooltip" data-placement="auto"  data-parsley-required="true" data-original-title="排序从0~999顺序排列，默认排序为0。" data-parsley-range="[0,999]" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-md-2 col-sm-3">是否显示&nbsp;*: </label>
                        <div class="col-md-9 col-sm-8">
                            <input type="checkbox" class="status" autocomplete="off"
                                   data-input-name="status"
                                   data-size="small"
                                   data-on-color="primary"
                                   data-on-text="显示"
                                   data-off-text="隐藏"
                                   data-input-true="1"
                                   data-input-false="2"
                                   checked/>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer"> <a href="javascript:;" class="btn btn-white" data-dismiss="modal">放弃操作</a> <a href="javascript:;" class="btn btn-primary" data-loading-text="Loading..." nc-ajax-submit-target="editForm" nc-ajax-submit>确认提交</a> </div>
        </div>
    </div>
</div>
<!-- 结束编辑管理员模态窗口 -->



</@list.html>
<!-- ================== 开始页面级JavaScrip调用 ================== -->
<script src="${pluginsRoot}bootstrap-wizard/js/bwizard.js"></script>
<!-- 表单checkbox项 -->
<script src="${pluginsRoot}bootstrap-switch/bootstrap-switch.min.js"></script>
<!-- 日历控件 -->
<script src="${pluginsRoot}/jquery.dtGrid/dependents/datePicker/WdatePicker.js" defer="defer"></script>
<script src="${jsRoot}operate/banner.handle.js"></script>
<!-- ================== 结束页面级JavaScrip调用 ================== -->
</@c.html>
